module.exports = {
  schema: {
    member: () => {
      return new Member()
    },
    cash: () => {
      return new Cash()
    },
    incomes: () => {
      return new Incomes()
    },
    account: () => {
      return new Account()
    },
    tbk: () => {
      return new Tbk()
    },
    order: () => {
      return new Order()
    },
    group: () => {
      return new Group()
    },
    groupCode: () => {
      return new GroupCode()
    },
    WechatUser: () => {
      return new WechatUser()
    }
  },
  user: () => {
    return new User()
  },
  role: (name, ACL) => {
    return new Role()
  },
  ACL: () => {
    return new Parse.ACL()
  },
  file: (name, file, mind) => {
    return new Parse.File(name, file, mind)
  }
}

class SuperObject extends Parse.Object {
  constructor (name) {
    super(name)
    this.name = name
  }
  query () {
    return new Parse.Query(this.name)
  }
}

class Member extends SuperObject {
  constructor () {
    super('Member')
  }
}

class Cash extends SuperObject {
  constructor () {
    super('Cash')
  }
}

class Incomes extends SuperObject {
  constructor () {
    super('Incomes')
  }
}

class Account extends SuperObject {
  constructor () {
    super('Account')
  }
}

class Tbk extends SuperObject {
  constructor () {
    super('Tbk')
  }
}

class Order extends SuperObject {
  constructor () {
    super('Order')
  }
}

class Group extends SuperObject {
  constructor () {
    super('Group')
  }
}

class WechatUser extends SuperObject {
  constructor () {
    super('WechatUser')
  }
}

class GroupCode extends SuperObject {
  constructor () {
    super('GroupCode')
  }
}

class User extends Parse.User {
  constructor () {
    super('User')
  }
  query () {
    return new Parse.Query(Parse.User)
  }
}

class Role extends Parse.Role {
  constructor () {
    super('Role')
  }
  query () {
    return new Parse.Query(Parse.Role)
  }
}
